package com.base.cn.platform.os.service.course.agent.income;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.course.CourseBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.Map;

/**
 * 推广员总收益接口
 *
 * @author LIZHIPENG
 * @since 2018/5/7
 */
@FeignClient(name = CourseBaseService.appName, configuration = FeignAuthConfig.class)
public interface AgentIncomeService extends CourseBaseService {

    /**
     * 查询收益列表
     * @param currentPage 页码
     * @param params 条件
     * @param agentUserData 是否设置推广员数据（true：是，false：否）
     * @return
     */
    @RequestMapping(contextPath + "/queryAgentIncomeListPage")
    Map<String, Object> queryAgentIncomeListPage(@RequestParam(value = "currentPage", required = false, defaultValue = "1") int currentPage,
                                                 @RequestBody Map<String, Object> params,
                                                 @RequestParam("agentUserData") boolean agentUserData);

    /**
     * 根据推广员ID查询总收益
     * @param agentUserId 推广员ID
     * @param agentUserData 是否设置推广员数据（true：是，false：否）
     * @return
     */
    @RequestMapping(contextPath + "/findAgentIncomeById")
    Map<String, Object> findAgentIncomeById(@RequestParam("agentUserId") BigDecimal agentUserId,
                                            @RequestParam("agentUserData") boolean agentUserData);
}
